package com.zmj.framework.base.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
 * @author scy
 * 基础Entity
 */
@Data
public class BaseEntity implements IEntity, Serializable {

    @ApiModelProperty(value = "编号", hidden = true)
    @TableId(type = IdType.AUTO)
    private String id;

    @ApiModelProperty(value = "创建人", hidden = true)
    @TableField(fill = FieldFill.INSERT)
    @ExcelProperty("创建人")
    private String createUser;

    @ApiModelProperty(value = "创建时间", hidden = true)
    @TableField(fill = FieldFill.INSERT)
    @ExcelProperty("创建时间")
    private Long createTime;

    @ApiModelProperty(value = "更新人", hidden = true)
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ExcelProperty("更新人")
    private String updateUser;

    @ApiModelProperty(value = "更新时间", hidden = true)
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ExcelProperty("更新时间")
    private Long updateTime;

    /**
     * 状态[0:未删除,1:删除]
     */
    @ApiModelProperty(value = "是否已删除", hidden = true)
    @TableLogic(value = "0", delval = "1")
    @TableField(fill = FieldFill.INSERT)
    private String isDeleted;
}
